perm filename SIMP.PRO[206,JMC] blob
sn#005309 filedate 1972-07-11 generic text, type T, neo UTF8
00100 PROJECT ON ALGEBRAIC SIMPLIFICATION
00200
00300
00400 Write an MLISP program to simplify algebraic expressions
00500 consisting of sums, products, differences and quotients written
00600 in the LISP S-expression notation used in class. These expressions
00700 have the syntax
00800
00900 <expression> ::= <integer>|<variable>|<sum>|<product>|
01000 <difference>|<quotient>
01100
01200 <integer> ::= <integer as in the LISP 1.6 Manual>
01300
01400 <variable> ::= <LISP non-numeric atom with the flag VAR on
01500 its property list>
01600
01700 <sum> ::= (PLUS[ <expression>]*)
01800
01900 <product> ::= (TIMES[ <expression>]*)
02000
02100 <difference> ::= (DIFFERENCE <expression> <expression>)
02200
02300 <quotient> ::= (QUOTIENT <expression> <expression>)
02400
02500 Your program should be a function called SIMPLIFY, and
02600 it should do as many as possible of the following simplifications:
02700
02800 1. Elimination of 0 and 1 terms from sums and products
02900 respectively and elimination of products with 0 terms.
03000
03100 2. Elimination of sums and products with only one term or
03200 no terms at all.
03300
03400 3. Collapsing of sums of sums and products of products.
03500
03600 4. Collection of terms with numerical coefficients and
03700 combination of coefficients.
03800